<?php

use Phinx\Migration\AbstractMigration;

class CreateGlobalIdIndexInChatTable extends AbstractMigration
{
    public function up()
    {
        $this->table("chat")
            ->addIndex(["global_id"], [
                'type' => 'unique',
                'name' => 'idx_unique_global_id'
            ])
            ->save();
    }

    public function down()
    {
        $this->table("chat")
            ->removeIndexByName("idx_unique_global_id")
            ->save();
    }
}
